"""
Utility functions and classes for Parameter-Efficient Fine-Tuning (PEFT).

This package provides shared utilities including error handling, model introspection,
and common helper functions used across different PEFT implementations.
"""

# Exception classes
from continuallearning.models.pefts.common.utils.exceptions import (
    PEFTError,
    ConfigurationError,
    AdapterError,
    HookError,
    HookAttachError,
    HookDetachError,
    ForwardPassError,
)

# Error handling utilities
from continuallearning.models.pefts.common.utils.error_handlers import (
    handle_peft_errors,
)

# Model introspection utilities
from continuallearning.models.pefts.common.utils.model_utils import (
    detect_attention_heads,
    detect_hidden_size,
    detect_model_layers,
)

# General utilities
from continuallearning.models.pefts.common.utils.utils import (
    ModuleDetector,
    is_linear_module,
    is_conv_module,
    create_hook_factory,
)

__all__ = [
    # Exception classes
    "PEFTError",
    "ConfigurationError",
    "AdapterError",
    "HookError",
    "HookAttachError",
    "HookDetachError",
    "ForwardPassError",
    # Error handling
    "handle_peft_errors",
    # Model introspection
    "detect_attention_heads",
    "detect_hidden_size",
    "detect_model_layers",
    # Module detection and utilities
    "ModuleDetector",
    "is_linear_module",
    "is_conv_module",
    "create_hook_factory",
]
